<%
	var Recordset=new Class.create();
		Recordset.prototype=
		{			
			initialize:function($source,$options)
			{
				this.object=Server.CreateObject('ADODB.Recordset');
				this.object.CursorLocation=adUseClient;
				this.result=null;
				
				if(arguments.length!=0)
				{		
					if($source==undefined) throw 'Source error';
					$options=($options||{});
					
					/* 声明属性 */
					this.source=$source;
					this.activeconnection=$options.activeconnection;
					this.cursortype=($options.cursortype||3);
					this.locktype=($options.locktype||1);
					this.pagesize=(parseInt($options.pagesize)||10);
					this.absolutepage=(parseInt($options.absolutepage)||1);
					this.isopen=($options.isopen==false) ? false:true;
								
					if(isNaN(this.pagesize)) throw 'Pagesize error';
					if(isNaN(this.absolutepage)) throw 'Absolutepage error';
					
					/* 构造对象 */
					try
					{																											
						if(this.activeconnection==undefined&&typeof($System)!='undefined')
						{
							this.activeconnection=(new Connection($System.connection)).object;
						}	 					
						this.object.activeconnection=this.activeconnection;
						this.object.cursortype=this.cursortype;
						this.object.locktype=this.locktype;
						
						if(this.isopen==true)
						{				
							if(this.activeconnection==undefined) throw 'Connection error';
							this.object.Open
							(
								this.source,this.activeconnection,
								this.cursortype,this.locktype,this.commandtype						
							);		
							this.object.pagesize=this.pagesize;
							this.object.absolutepage=this.absolutepage;
						}
					}
					catch(e)
					{
						if(e=='Source error')
							throw new Error(cusErrors_0030_ADO$Recordset);
						if(e=='Connection error')
							throw new Error(cusErrors_0031_ADO$Recordset);
						else
						{
							if(e!=cusFrameworkDo$Break&&Object.varType(e)!='string')							
								throw e;
							else
								throw new Error(e);							
						}						
					}
				}
				
			},			
			properties:function()
			{
				return this.object.Properties;		
			},
			fields:function()
			{
				return this.object.Fields;		
			},
			get:function($property)
			{
				if(($property in this.object)==false)		
					throw new Error(cusErrors_0099_ADO$Global);
					
				$property=($property.toLowerCase());
				if($property in this.object) this[$property]=this.object[$property];				
				return this.object[$property];
			},			
			set:function($property,$value)
			{
				if(($property in this.object)==false)
					throw new Error(cusErrors_0099_ADO$Global);
					
				$property=($property.toLowerCase());				
				this[$property]=$value;
				return this.object[$property]=$value;
			},
			open:function($source,$activeconnection,$cursortype,$locktype,$options)
			{
				try
				{
					var tempSource=$source||this.source;
					var tempActiveConnection=$activeconnection||this.activeconnection;
					
					if(tempSource==undefined) throw 'Source error';
					if(tempActiveConnection==undefined) throw 'Connection error';
					
					this.object.open
					(
						tempSource,
						tempActiveConnection,
						$cursortype||this.cursortype,
						$locktype||this.locktype,
						$options||-1
					);	
					this.object.pagesize=this.pagesize;
					this.object.absolutepage=this.absolutepage;
				}
				catch(e)
				{
					if(e=='Source error')
						throw new Error(cusErrors_0030_ADO$Recordset);
					if(e=='Connection error')
						throw new Error(cusErrors_0031_ADO$Recordset);
					else
					{
						if(e!=cusFrameworkDo$Break&&Object.varType(e)!='string')							
							throw e;
						else
							throw new Error(e);							
					}				
				}					
			},	
			close:function()
			{
				try
				{
					this.object.Close(),this.object=null;
				}
				catch(e)
				{}
			},
			pageToolbar:function(type,parameters)
			{
				switch(type)
				{
					case 'simple':
						return 'simple'
						break;
					case 'simple1':
						return 'simple1';
						break;
					default:
						return 'default';
				}				
			},
			getModule:function()
			{
				return {title:['aasdfasdfasdfa','basdfasdfb'],datetime:['6-25','6-26'],id:['1','2']};
			}
		};
%>